package com.yihua.utils;

import java.awt.*;

public class GameUtils {
    //蛇头
    public static Image upImg = Toolkit.getDefaultToolkit().getImage("img/up.png");
    public static Image downImg = Toolkit.getDefaultToolkit().getImage("img/down.png");
    public static Image leftImg = Toolkit.getDefaultToolkit().getImage("img/left.png");
    public static Image rightImg = Toolkit.getDefaultToolkit().getImage("img/right.png");
    //身体
    public static Image bodyImg = Toolkit.getDefaultToolkit().getImage("img/body.png");
    //食物
    public static Image foodImg = Toolkit.getDefaultToolkit().getImage("img/food.png");

    //绘制文字 (画笔，需要绘制的字符串，字符串颜色，字符串字体大小,字符串位置)
    public static void drawWord(Graphics g,String s,Color color,int size,int x,int y){
        //设置字体颜色
        g.setColor(color);
        //设置字体样式
        g.setFont(new Font("楷体",Font.BOLD,size));
        //将文字绘制到屏幕上
        g.drawString(s,x,y);
    }
}
